import request from '@/utils/request'

export function getAllRefund() {
    return request({
        url: '/refund/all',
        method: 'get'
    })
}

export function updateRefundState(id, state) {
    return request({
        url: '/refund/',
        method: 'put',
        params: {
            orderId: id,
            state: state
        }
    })
}

export function insertRefund(id, orderId, campusName, orgName, state, userId, userName, userPhone) {
    return request({
        url: '/refund/',
        method: 'post',
        params: {
            id: id,
            orderId: orderId,
            campusName: campusName,
            orgName: orgName,
            state: state,
            userId: userId,
            userName: userName,
            userPhone: userPhone
        }
    })
}

export function refund(id, orderId, oriTranDate, totalPrice) {
    return request({
        url: '/pay/refund',
        method: 'post',
        params: {
            id: id,
            orderId: orderId,
            oriTranDate: oriTranDate,
            totalPrice: totalPrice
        }
    })
}